package com.usian.listener;

import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class MsgListener {



    @RabbitListener(bindings = @QueueBinding(
            value = @Queue(value="queue_h2007b",durable = "true"),
            exchange = @Exchange(value="exchange_h2007b",type= ExchangeTypes.TOPIC),
            key= {"*.*"}
    ))
    public void listen(String msg){
        System.out.println("1111111111111111111111111111111111111111");
        System.out.println("接收到消息：" + msg);
    }

}
